package com.jh.netty.hj2122017.pojo;


import java.net.Socket;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class SocketPo {
    /**
     * 当线程池中线程的数目大于5时，便将任务放入任务缓存队列里面，当任务缓存队列满了之后，便创建新的线程。
     * */
    public static ThreadPoolExecutor socketpool=new ThreadPoolExecutor(10,30,200, TimeUnit.MILLISECONDS,  new ArrayBlockingQueue<Runnable>(5));
    /**
     * 已连接的客户端
     */
    public static Map<String, Socket> clientSocketMap=new HashMap<>();
    /**
     * socket服务 端口
     */
    @Deprecated
    public static final int SOCKET_SERVER_PORT = getServerPort();

    @Deprecated
    public static int getServerPort() {
        return 9090;
    }

}
